import urllib.request

def load_baidu():
    url='https://www.baidu.com'
    headers = {
        'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36'
    }
    request=urllib.request.Request(url,headers=headers)
    print(request.headers)#{}
    response=urllib.request.urlopen(request)
    print(response.headers)
    final_url=request.get_full_url()
    print(final_url)
load_baidu()